home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Devices / EgretWakeup / EgretWakeUp.a next >
Encoding:
Text File  |  1993-11-09  |  1.8 KB  |  62 lines  |  [TEXT/MPS ]

  1. ;________________________________________________________________________________________________
  2. ;  File:  EgretWakeUp.a
  3. ;  11/02/93 DTS
  4. ;________________________________________________________________________________________________
  5.  
  6.             BLANKS        ON
  7.             STRING        ASIS
  8.  
  9.             PRINT        OFF
  10.             
  11.             MACHINE        MC68020
  12.  
  13.             INCLUDE        'EgretWakeUpEqu.a'
  14.             INCLUDE        'Traps.a'
  15.             
  16.             PRINT        ON
  17.  
  18.  
  19. ;________________________________________________________________________________________________
  20. ;  PROCEDURE SetEgretWakeUpTime(WakeUpWhen: LONGINT);
  21. ;
  22. ;    This external Pascal procedure calls the egret trap set a wake up time for the IIsi.
  23. ;
  24. ;    Input arguments:    (on stack) Wake up time in seconds
  25. ;    Returns:            nothing
  26. ;    Destroys:            a1
  27. ;________________________________________________________________________________________________
  28.  
  29. SetEgretWakeUpTime    PROC    EXPORT                            ;it's a procedure, make it visible to outside
  30.  
  31.  
  32. BuildPB        move.l    a0,    -(sp)                                ;save a0
  33.             sub.l    #EgretPB.EgretPBSize,sp                    ;make a param block on stack
  34.             move.l    sp,    a0                                    ;point a0 to pb
  35.             
  36. ;fill in the parameter block
  37.  
  38.             move.b    #pseudoPkt,        EgretPB.pbCmdType(a0)
  39.             move.b    #WrPwrupTime,    EgretPB.pbCmd(a0)
  40.             move.l    4(a7),            EgretPB.pbParam(a0)        ;copy wake up time to pb.
  41.             clr.w                    EgretPB.pbByteCnt(a0)    ;Power Up CDEV does this (instead of 
  42.                                                             ;move.w #4, EgretPB.pbByteCnt(a0)
  43.             clr.l                    EgretPB.pbBufPtr(a0)
  44.             clr.b                    EgretPB.pbFlags(a0)
  45.             clr.b                    EgretPB.pbSpareFlags(a0)
  46.             clr.w                    EgretPB.pbResult(a0)
  47.             clr.l                    EgretPB.pbCompletion(a0)
  48.                         
  49.             _EgretDispatch
  50.             
  51.             add.l    #EgretPB.EgretPBSize,sp                    ;strip pb off stack
  52.             
  53. returnToCaller
  54.             move.l    (sp)+,a0                                ;Restore a0
  55.             move.l    (sp)+,a1                                ;pop return address
  56.             add.l    #4,sp                                    ;kill input argument (wake up time)
  57.             jmp        (a1)                                    ;return
  58.             ENDPROC
  59.     
  60.     
  61.             END
  62.